<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>端API</title>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <style>
        .empty{ text-align: center; padding: 120px 0; }
    </style>
</head>
<body>
    <div class="empty">端API</div>
    <div onclick="getAjax()">点我发请求</div>
    <script>
      function getAjax (){
        api.ajax({
          url: 'https://www.51jili.com/Api/login',
          method: 'get',
          headers:{
              "User-Agent":navigator.userAgent
          },
          data:{
              values:{
                'apptype':'ios',
                'appver':2.1,
                'account':'13425718756',
                'password':'123a123b'
              }
          },
        }, function(ret, err) {
          if (ret) {
              alert(window.navigator.userAgent)
              api.alert({ msg: JSON.stringify(ret) });
          } else {
              api.alert({ msg: JSON.stringify(err) });
          }
        })
      }
    </script>
</body>
</html>
